package com.example.newsclient;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebView;
import android.webkit.WebViewClient;

/**
 * 详细新闻界面
 */
public class DetailedActivity extends AppCompatActivity {

    private WebView news_webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detailed);
        initView();
        //获取新闻链接
        String news_url = getIntent().getStringExtra("news_url");
        news_webView.setWebViewClient(new WebViewClient());
        news_webView.getSettings().setJavaScriptEnabled(true);//支持JavaScript
        //加载网页
        news_webView.loadUrl(news_url);
    }

    private void initView() {
        news_webView = (WebView) findViewById(R.id.news_webView);
    }
}
